<?php

/**
 * docente filter form base class.
 *
 * @package    sistema_itec_new
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BasedocenteFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'etiqueta'                    => new sfWidgetFormFilterInput(),
      'etiqueta_titulo'             => new sfWidgetFormFilterInput(),
      'inicio_actividad_docente'    => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'fecha_ingreso'               => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'legajo_provincial'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'cuil'                        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'experiencia_laboral'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'experiencia_laboral_docente' => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'etiqueta'                    => new sfValidatorPass(array('required' => false)),
      'etiqueta_titulo'             => new sfValidatorPass(array('required' => false)),
      'inicio_actividad_docente'    => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'fecha_ingreso'               => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'legajo_provincial'           => new sfValidatorPass(array('required' => false)),
      'cuil'                        => new sfValidatorPass(array('required' => false)),
      'experiencia_laboral'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'experiencia_laboral_docente' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('docente_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'docente';
  }

  public function getFields()
  {
    return array(
      'persona_id'                  => 'Number',
      'etiqueta'                    => 'Text',
      'etiqueta_titulo'             => 'Text',
      'inicio_actividad_docente'    => 'Date',
      'fecha_ingreso'               => 'Date',
      'legajo_provincial'           => 'Text',
      'cuil'                        => 'Text',
      'experiencia_laboral'         => 'Number',
      'experiencia_laboral_docente' => 'Number',
    );
  }
}
